#include "json.h"
#include "AbstractFactory.h"
#include "ClassObjectPool.h"
#include "UIBase.h"


#define CLASSHEAD(CLASSNAME) \
class Page##CLASSNAME: public PageBase {\
public:\
void MsgProc() {\
ClassObjectPool obj;\
std::shared_ptr<PageUsr> msgProcCls = obj.Get<PageUsr>(GetPageName());\
msgProcCls->MsgProc();\
}\
void UpData() {\
ClassObjectPool obj;\
std::shared_ptr<PageUsr> msgProcCls = obj.Get<PageUsr>(GetPageName());\
msgProcCls->UpData();    \
}\


#define CLASSBODY(CLASSNAME) \
Page##CLASSNAME(const int x, const int y, const int width, const int height)\
:PageBase()\
{\


#define CLASSTAIL\
MessageBus bus;\
bus.Attach([this]() {\
MsgProc();\
}, "GUI");\
\nbus.Attach([this]() {\
UpData();\
}, "STATUS");}\

extern "C" void InitGUI();


